<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="sf " uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="s " uri="http://www.springframework.org/tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<title>角色主页</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%@ include file="/WEB-INF/common.jsp"%>

<link href="${path }/resources/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<link href="${path }/resources/css/animate.css" rel="stylesheet">
<link href="${path }/resources/css/style.css?v=4.1.0" rel="stylesheet">

<!--dataTables css样式-->
<link rel="stylesheet" type="text/css"
	href="${path }/resources/css/jquery.dataTables.min.css">
<!--DataTables button扩展-->
<link rel="stylesheet" type="text/css"
	href="${path }/resources/css/buttons.dataTables.min.css">
<link rel="stylesheet" type="text/css"
	href="${path }/resources/css/form.css">


</head>
<style type="text/css" rel="stylesheet">
        #provinceDiv {
            width:150px;
            margin-left:20px;
            display:inline-block;
        }
        #cityDiv{
            width:150px;
            margin-left:20px;
            display:inline-block;
        }
        #districtDiv{
            width:150px;
            margin-left:20px;
            display:inline-block;
        } 
</style>
<body class="gray-bg" style="">
<jsp:include page="/WEB-INF/loginCheck.jsp" />
	<div>
		<h1 style="margin-left:20px">编辑所属维保企业</h1>
	</div>
	<hr>
	<!--修改的表单  -->
	<div id="" barclass="panel-body" style="margin-top: 30px">
		<form id="cForm" action="${path }/Enterprise/updateEnterpriseForEnterAdmin.htm" method="post" data-parsley-validate
										class="form-horizontal form-label-left"  enctype="multipart/form-data">
			<input type="hidden" name="id" value="${content.id}">
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">维保企业<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input  value="${content.name}" name="name" class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="first-name">维保企业身份<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<select id="identify" class="selectpicker form-control" data-live-search="true" name="identify">
						<option value="城市合伙人">城市合伙人</option>
						<option value="维保企业">维保企业</option>
					</select>
					<input type="hidden" id="identifyHidden" value="${content.identify}">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">企业地址<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<div id="distpicker5">
						<div class="form-group" id="provinceDiv">
							<label class="sr-only" for="province">Province</label> <select
								class="form-control" id="province" name="province" ></select>
						</div>
						<div class="form-group" id="cityDiv">
							<label class="sr-only" for="city">City</label> <select
								class="form-control" id="city" name="city" ></select>
						</div>
						<div class="form-group" id="districtDiv">
							<label class="sr-only" for="district">District</label> <select
								class="form-control" id="district" name="area" ></select>
						</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">详细地址<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input  value="${content.address}" name="address" class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">资质<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<select id="qualification" class="selectpicker form-control" data-live-search="true" name="qualification">
						<option value="其他">其他</option>
						<option value="消防设施维护保养检测：三级">消防设施维护保养检测：三级</option>
						<option value="消防设施维护保养检测：二级">消防设施维护保养检测：二级</option>
						<option value="防设施维护保养检测：一级">消防设施维护保养检测：一级</option>
					</select>
					<input type="hidden" id="qualificationHidden" value="${content.qualification}">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">法人姓名<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input  value="${content.legalName}" name="legalName" class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">法人联系电话<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input  type="tel"  value="${content.legalPhone}" name="legalPhone" class="form-control col-md-7 col-xs-12"  maxlength="11">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">技术负责人<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input value="${content.technicalDirector}" name="technicalDirector"  class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">技术负责人联系电话<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input  type="tel" value="${content.technicalPhone}" name="technicalPhone" class="form-control col-md-7 col-xs-12" maxlength="11">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">服务电话<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input  type="tel"  value="${content.servicePhone}" name="sevicePhone" class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-md-3 col-sm-3 col-xs-12"
					for="last-name">企业人数<span class="required">*</span>
				</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					<input  type="number"  value="${content.employeNumber}" name="employeNumber" class="form-control col-md-7 col-xs-12">
				</div>
			</div>
			<!-- 上传图片 -->
			<div class="form-group">
				<label for="middle-name"
					class="control-label col-md-3 col-sm-3 col-xs-12">资质证书图片</label>
				<div class="col-md-6 col-sm-6 col-xs-12">
					 <input type="file" name="file" accept="image/gif,image/jpeg,image/jpg,image/png" value="${content.certificatePicture}">
							<span></span>
				</div>
			</div>
			<div class="form-group">
				<div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3" >
					<button type="submit" class="btn btn-success">提交</button>
				</div>
			</div>
		</form>

	</div>
	


	
	<!-- Peity-->
	<script src="${path }/resources/js/plugins/peity/jquery.peity.min.js"></script>
	
	<!-- Bootstrap table-->
	<script src="${path }/resources/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
	<script src="${path }/resources/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>

	<!-- 自定义js-->
	<script src="${path }/resources/js/content.js?v=1.0.0"></script>
	
	<!-- jQuery Validation plugin javascript-->
    <script src="${path }/resources/js/plugins/validate/jquery.validate.min.js"></script>
    <script src="${path }/resources/js/plugins/validate/messages_zh.min.js"></script>
   
   	<!-- jQuery form  -->
    <script src="${path }/resources/js/jquery.form.min.js"></script>
    
    <!-- layer javascript -->
    <script src="${path }/resources/js/plugins/layer/layer.min.js"></script>
    <!-- 省市联动 -->
	<script src="${path }/resources/js/distpicker.data.js"></script>
	<script src="${path }/resources/js/distpicker.js"></script>
	<script src="${path }/resources/js/main.js"></script>
    
    
	<script type="text/javascript">
	window.onload=function(){ 
		var identify = $("#identifyHidden").val();//设置当前身份选中项
		$("#identify").val(identify);
		
		var qualification = $("#qualificationHidden").val();//设置当前所属维保企业选中项
		$("#qualification").val(qualification);

		}
	$('#distpicker5').distpicker({
		  province: '${content.province}',
		  city: '${content.city}',
		  district: '${content.area}'
		});
	</script>
	<script type="text/javascript">
	$("#cForm").validate({
		onsubmit:true,// 是否在提交是验证
		onfocusout:false,// 是否在获取焦点时验证
		onkeyupd :false,// 是否在敲击键盘时验证
		
		rules:{
			name:{
				required:true
			},
			address:{
				required:true
			},
			legalName:{
				required:true,
			},
			legalPhone:{
				required:true,
			 	digits:true,
			 	rangelength:[11,11],//输入长度
			},
			technicalDirector:{
				required:true,
			},
			technicalPhone:{
				required:true,
			 	digits:true,
			 	rangelength:[11,11],//输入长度
			},
			sevicePhone:{
				required:true,
				digits:true,
			},
			employeNumber:{
				required:true,
				digits:true,
			},
		},
		messages:{
			name:{
				required:"请输入维保企业"
			},
			address:{
				required:"请输入详细地址"
			},
			legalName:{
				required:"请输入法人姓名",
			},
			legalPhone:{
				required:"请输入法人联系电话",
			 	digits:"电话号码必须是数字",
			 	rangelength:"电话号码必须是11位",//输入长度
			},
			technicalDirector:{
				required:"请输入技术负责人姓名",
			},
			technicalPhone:{
				required:"请输入技术负责人电话",
			 	digits:"电话号码必须是数字",
			 	rangelength:"电话号码必须是11位",//输入长度
			},
			sevicePhone:{
				required:"请输入服务电话",
			 	digits:"电话号码必须是数字",
			},
			employeNumber:{
				required:"请输入企业人数",
				digits:"企业人数必须是数字",
			},
		},
		submitHandler:function(form){//通过之后回调
			form.submit();
		}
		
	});
	</script>
</body>
</html>